#ifndef H_TUXLIB_SOCKET_COMMON_H
#define H_TUXLIB_SOCKET_COMMON_H

#include <sys/socket.h>
#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>

namespace Tux { namespace Socket 
{
    /**
     * Domains
     **/
    namespace DomainType
    {
        enum Enum
        {
            LOCAL,
            IPv4,
            IPv6
        };

        char const* ToString(Enum e);
    };

    struct LocalDomainTraits
    {
        typedef struct sockaddr_un SocketAddress;
        static int const AF_VALUE = AF_UNIX; // AF_LOCAL;
        static DomainType::Enum const TYPE = DomainType::LOCAL;

        static SocketAddress CreateSocketAddress(char const* name);
        static socklen_t SizeOfSocketAddress(SocketAddress const& address);
    };

    /**
     * SocketTypes
     **/
    namespace SocketType
    {
        enum Enum
        {
            DATAGRAM,
            STREAM
        };

        char const* ToString(Enum e);
    };

    struct DatagramSocketTraits
    {
        static int const SOCK_VALUE = SOCK_DGRAM;
        static SocketType::Enum const TYPE = SocketType::DATAGRAM;
    };

    struct StreamSocketTraits
    {
        static int const SOCK_VALUE = SOCK_STREAM;
        static SocketType::Enum const TYPE = SocketType::STREAM;
    };

    /**
     * Message Vector
     **/
     /*
    class MessageVector
    {
    public:
        MessageVector(unsigned msg_capacity, unsigned vector_capacity);
        ~MessageVector();
        
        void Clear()                    { mVectorLength = 0; }
        unsigned GetCapacity() const    { return mVectorCapacity; }
        struct mmsghdr* GetMMsgHdr()    { return mMMsgHdr; }
    };*/
}}

#endif

